package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /**
     * 新增员工
     * @param employee
     */
    @AutoFill(OperationType.INSERT)
    void inster(Employee employee);

    /**
     * 分页查询员工
     * @param name
     * @return
     */

    Page<Employee> getPageByName(String name);


    /**
     * 修改员工账号状态
     * @param status
     * @param id
     */
    void updateStatus(Long status, Integer id);

    /**
     * 回显数据
     * @param id
     * @return
     */
    Employee getById(Long id);

    /**
     * 修改员工(编辑员工信息)
     * @param employee
     */
    void updateEmp(Employee employee);
}
